//=============================================================================

#ifndef ASYSTEM_H
  #define ASYSTEM_H

//=============================================================================

#include <afxwin.h>
//#include <windows.h>
#include <gl/gl.h>
#include <gl/glu.h>
#include "aCamera.h"

//=============================================================================

#pragma comment(lib, "opengl32.lib")
#pragma comment(lib, "glu32.lib")

//=============================================================================

class aSystem
{
	public:
      inline HDC asGetDC() {return hDc;}
      inline HGLRC asGetRC() {return hRc;}
      inline unsigned int asGetFPS() {return frameRate;}
      inline int asGetX() {return windowX;}
      inline int asGetY() {return windowY;}
      inline int asGetW() {return windowWidth;}
      inline int asGetH() {return windowHeight;}
      inline float asGetCameraSpeed() {return cameraSpeed;}
      inline LPRECT asGetRect() {return winRect;}
      inline void asSetFov(float f) {fov = f;}
      inline unsigned int asGetFixedFPS() {return fixedFps;}
      inline void asGetRect(CRect& rect) {rect.top = winRect->top; rect.right = winRect->right; rect.bottom = winRect->bottom; rect.left = winRect->left;}

    aSystem();
		  virtual bool asInitOGL(HDC dc, LPRECT rect);
		  virtual void asBeginToPaint();
		  virtual void asKeyPress();
      void asGetFrameRate();
      void asSetOrtho();
      void asSetPerspective();
		~aSystem();
  
  public:  
    aCamera camera;

  protected:
		HWND hWnd;
		HGLRC hRc;
		HDC hDc;
    LPRECT winRect;
		int windowX;
		int windowY;
		int windowWidth;
		int windowHeight;
		float nearClip;
		float farClip;
		float fov;
    unsigned int frameRate;
    float framesInterval;
    unsigned int fixedFps;
    float motionRate;
    float cameraSpeed;
    float dt;
    GLuint fontBase;
};

//=============================================================================

#endif

//=============================================================================
